package org.jetlinks.pro.koudai.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.hswebframework.web.dict.Dict;
import org.hswebframework.web.dict.EnumDict;

@AllArgsConstructor
@Getter
@Dict("resource-type")
public enum ResourceType implements EnumDict<String> {
    unknown("未知"),
    pdfTutorial("PDF讲义"),
    wordTutorial("Word讲义"),
    excel("Excel表格"),
    simulate("仿真模型"),
    videoTutorial("教学视频");

    private final String text;

    @Override
    public String getValue() {
        return name();
    }

    public static ResourceType of(byte state) {
        switch (state) {
            case ResourceT.pdfTutorial:
                return pdfTutorial;
            case ResourceT.wordTutorial:
                return wordTutorial;
            case ResourceT.excel:
                return excel;
            case ResourceT.simulate:
                return simulate;
            case ResourceT.videoTutorial:
                return videoTutorial;
            default:
                return unknown;
        }
    }
}
